import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            meta: {
                auth: false,
                title: '首页'
            },
            component: resolve => require(['../components/body/index.vue'], resolve),
            children:[
                {
                    path: '',
                    meta: {
                        auth: false,
                        title: ''
                    },
                    name:'default',
                    component: resolve => require(['../components/index/index.vue'], resolve)
                },
                {
                    path: '/:currency',
                    meta: {
                        auth: false,
                        title: ''
                    },
                    name:'explore',
                    component: resolve => require(['../components/index/index.vue'], resolve)
                },
                {
                    path: '/block/:has/:type',
                    meta: {
                        auth: false,
                        title: 'block'
                    },
                    name:'block',
                    component: resolve => require(['../components/block/index.vue'], resolve)
                },
                {
                    path: '/tx/:txid',
                    meta: {
                        auth: false,
                        title: 'tx'
                    },
                    name:'tx',
                    component: resolve => require(['../components/tx/index.vue'], resolve)
                },
                {
                    // path: '/update/:datas',
                    path: '/network',
                    meta: {
                        auth: false,
                        title: 'network'
                    },
                    name:'network',
                    component: resolve => require(['../components/network/index.vue'], resolve)
                },
                {
                    path: '/movement',
                    meta: {
                        auth: false,
                        title: 'movement'
                    },
                    name:'movement',
                    component: resolve => require(['../components/movement/index.vue'], resolve)
                },
                {
                    path: '/richlist',
                    meta: {
                        auth: false,
                        title: 'richlist'
                    },
                    name:'richlist',
                    component: resolve => require(['../components/richlist/index.vue'], resolve)
                },
                {
                    path: '/address/:has',
                    meta: {
                        auth: false,
                        title: 'address'
                    },
                    name:'address',
                    component: resolve => require(['../components/address/index.vue'], resolve)
                }
            ]
        },
        {
            path: '*',
            redirect: {name:'index'}
        }
    ]
})
